import React from 'react'
import { connect } from 'react-redux'
import { action, addAction } from '../redux/action'

function Home (props) {
  console.log(props, 'homeprops')
  const { value, list, getList } = props
  return (
    <div>
      Home中获取的value:{value}{list}
      <button onClick={() => getList(action('我是变更后的值'))}>变更数据</button>
    </div>

  )
}
const mapStateToProps = (state) => {
  console.log(state, 'mapStateToProps')
  return {
    ...state
  }
}
const mapDispatchToProps = (dispatch) => {
  return {
    getList: (action) => {
      dispatch(action)
    }
  }
}
export default connect(mapStateToProps, mapDispatchToProps)(Home)
